import request from '../utils/request';
import axios from 'axios';
import {FILE_MODULE, PIC_MODULE} from "./_prefix";

/**
 *  添加图片 POST /upload
 * @param {*} payload
 * @returns
 */
export const UploadFile = payload => {
    console.log(payload);
    const {userId, file, fileName} = payload;
    return axios.post(`${PIC_MODULE}/upload`, {
        userId, file, fileName
    }).then(res => {
        return res;
    });
}

/**
 *  获得图片列表 GET /get/all/proj
 * @param {*} payload
 * @returns
 */
export const GetAllFile = payload => {
    console.log(payload);
    const {userId} = payload;
    return axios.get(`${PIC_MODULE}/get/all/proj`, {params:{userId:userId}}).then(res => {
        return res;
    });
}

